/**
 * Copyright 2008 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package kiff.enumerator;

/**
 * Forum Type Enumerator.
 * @author Adam
 * @version $Id$
 * 
 * Created on Nov 28, 2008 at 3:57:24 PM 
 */
public enum ForumType implements GenericEnum<Byte> {
	/**
	 * Define the forum type value.
	 */
    FORUM((byte) 1, "Forum"),
    /**
     * Defines the category type value.
     */
    CATEGORY((byte) 0, "Category");

    /**
     * Returns a <code>Status</code> for a given byte value.
     * @param value The byte value.
     * @return A <code>Status</code>.
     */
    public static ForumType fromValue(final Byte value) {
    	switch (value) {
    	case 0: return CATEGORY;
    	case 1: return FORUM;
    	default: return CATEGORY;
    	}
    }

    /**
     * Label.
     */
    private String label;

    /**
     * Byte value.
     */
    private byte value;

    /**
     * Constructor.
     * @param value The value.
     * @param label The label.
     */
    private ForumType(final Byte value, final String label) {
        this.value = value;
        this.label = label;
    }

    /**
     * Returns the label for this status (Used for displaying).
     * @return The label.
     */
    public String getLabel() {
        return label;
    }

    /**
     * Returns the byte value.
     * @return The byte value.
     */
    public Byte getValue() {
        return value; 
    }
}
